package com.bdyc.test;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import com.bdyc.service.spring.ManagerInfoService;
import com.bdyc.service.spring.UserInfoService;

public class App extends TestSSM{
	@Autowired(required=true)
	@Qualifier("userInfoService")
	private UserInfoService userInfoServiceImpl;
	
	@Autowired(required=true)
	@Qualifier("managerInfoService")
	private ManagerInfoService managerInfoServiceImpl;
	@Test
	public void app(){
//		ManagerInfo managerInfo = new ManagerInfo();
//		managerInfo.setCreateTime(new Timestamp(new Date().getTime()));
//		managerInfo.setName("lisi");
//		managerInfo.setPass("123456");
//		managerInfoServiceImpl.addManagerInfo(managerInfo, 2);
//		UserInfo userInfo = new UserInfo();
//		userInfo.setName("wangwu");
//		userInfo.setPass("123456");
//		userInfo.setBirthday(new Date());
//		userInfo.setCreateTime(new Date());
//		userInfo.setLastLoginTime(new Date());
//		userInfoServiceImpl.addUserInfo(userInfo);
//		Map<String,Object> countMap = new HashMap<String,Object>();
//		countMap.put("rows", 6);
//		countMap.put("page",1);
////		countMap.put("name", "zhang");
//		countMap.put("realName", "馒头");
////		countMap.put("name", "z");
////		Integer a = userInfoServiceImpl.findUserInfoListCount(countMap);
////		System.out.println(a);
//		List<UserInfo> list = userInfoServiceImpl.findUserInfoList(countMap);
//		for (UserInfo userInfo : list) {
//			System.out.println(JSONObject.toJSONString(userInfo));
//		}
//		Integer roleId= 1;
//		ManagerInfo managerInfo = new ManagerInfo();
//		managerInfo.setName("adminmana");
//		managerInfo.setLastLoginTime(new Timestamp(new Date().getTime()));
//		managerInfo.setRealName("大馒头片1");
//		managerInfoServiceImpl.addManagerInfo(managerInfo, roleId);
		Map<String,Object> sendMap = new HashMap<String,Object>();
//		sendMap.put("realName", "馒头");
		Integer a = managerInfoServiceImpl.findUserInfoListCount(sendMap); 
		System.out.println(a);
	}
	
}
